<?php
namespace Index\Controller;
use Think\Controller;
class PublicController extends Controller {
	public function index(){
		$REDIRECT_URI='https://sunwayuchoice.com/index.php/Login/index';
		$scope='snsapi_base'; //静默授权 关注用户默认的权限
		//$scope='snsapi_userinfo'; //用户点击授权  未关注也可以获取
		$url='https://open.weixin.qq.com/connect/oauth2/authorize?appid='.C('APPID').'&redirect_uri='.urlencode($REDIRECT_URI).'&response_type=code&scope='.$scope.'&state=123#wechat_redirect';
		$recode= file_get_contents($url);
		//P($url);
		P($recode);
		//header("Location:".$url);
		$this->redirect('Login/index');
	}
}
?>